package common.http;

import android.content.Context;

import common.http.HttpResponse.SimpleHttpResponse;

public class HttpManager {
	public static final int HTTP_METHOD_POST 	= 1;
	public static final int HTTP_METHOD_GET  	= 2;
	public static final int HTTP_METHOD_DELETE	= 3;
	public static final int HTTP_METHOD_PUT		= 4;
	
	private volatile static HttpManager mInstance = null;
	
	private boolean isEnabledUrlConnection = false;

	private HttpManager(){}	
	
	public static HttpManager getInstance(){
		if(mInstance == null){
			synchronized(HttpManager.class){
				if(mInstance == null){
					mInstance = new HttpManager();
				}
			}
		}
		return mInstance;
	}
	
	public void setEnableUrlConnection(boolean isUse)
	{
		if(isUse){
			System.setProperty("http.keepAlive", "false");
		}
		this.isEnabledUrlConnection = isUse;
	}
	
	public boolean isEnableUrlConnection()
	{
		return this.isEnabledUrlConnection;
	}
	
	public SimpleHttpResponse requestData(Context context, int method, String url, String queryString){
		SimpleHttpResponse response = null;
		if(getNetworkType(context)){
			
		}
	}

	private boolean getNetworkType(Context context) {
		// TODO Auto-generated method stub
		return false;
	}
}
